package com.fruit.util;

public class ResultUtil {
	public static ResultInfo initResult(String state, String code, String message){
		ResultInfo ri = new ResultInfo();
		ri.setState(state);
		ri.setCode(code);
		ri.setMessage(message);
		return ri;
	}
	
	public static ResultInfo initResult(String state, String code, String message, String url){
		ResultInfo ri = new ResultInfo();
		ri.setState(state);
		ri.setCode(code);
		ri.setMessage(message);
		ri.setUrl(url);
		return ri;
	}
	
	public static ResultInfo initResult(String state, String code, String message, String url, String isRollBack){
		ResultInfo ri = new ResultInfo();
		ri.setState(state);
		ri.setCode(code);
		ri.setMessage(message);
		ri.setUrl(url);
		ri.setIsRollBack(isRollBack);
		return ri;
	}
	
	public static ResultInfo initResult(String state, String code, String message,Object obj){
		ResultInfo ri = new ResultInfo();
		ri.setState(state);
		ri.setCode(code);
		ri.setMessage(message);
		ri.setObj(obj);
		return ri;
	}
	public static ResultInfo initResult(String param, Object value){
		ResultInfo ri = new ResultInfo();
		ri.setParam(param);
		ri.setValue(value);
		return ri;
	}
}
